
import './App.css';

import { unstable_HistoryRouter as HistoryRouter,  BrowserRouter,Route,Routes } from 'react-router-dom';
import Login from './pages/Login';
import GeekLayout from './pages/Layout';
import {AuthComponent} from './components/AuthComponent'
import Publish from './pages/Publish/Publish';
import Article from './pages/Article/Article';
import Home from './pages/Home/Home';
import {history} from './utils/history'

function App() {
  return (
    <HistoryRouter  history={history}>
    <div className="App">
     
      <Routes>
        {/* Layout 需要鉴权处理的 */}
        {/* 这里的 Layout 不一定不能写死  要根据是否登录进行判断 */}
        <Route path='/' element={<AuthComponent><GeekLayout/></AuthComponent>}>
          <Route index element={<Home/>}> </Route>
          <Route path='article' element={<Article/>}></Route>
          <Route path='publish' element={<Publish/>}></Route>
        </Route>
        <Route path='/login' element={<Login/>}></Route>
        
      </Routes>
    </div>
    </HistoryRouter>
  );
}

export default App;
